package com.wandian.setting.mvvm.myevaluate;

import android.os.Bundle;
import android.view.View;

import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.mylib.libcore.config.RouterConfig;
import com.mylib.libcore.mvvm.BaseMVVMActivity;
import com.mylib.libcore.utils.StatusBarUtils;
import com.wandian.setting.R;
import com.wandian.setting.adapter.MyEvaluateRecycleAdapter;
import com.wandian.setting.databinding.SetActivityMyEvaluateBinding;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administrator
 * @date 2019/12/18-14:28
 * @description 评论-详情
 **/
@Route(path = RouterConfig.ROUTER_ACTIVITY_SETTING_MY_EVALUATE)
public class MyEvaluateActivity extends BaseMVVMActivity<MyEvaluateActivityViewModel> {
    private SetActivityMyEvaluateBinding dataBinding;
    private MyEvaluateRecycleAdapter myEvaluateRecycleAdapter;
    @Override
    public void init(Bundle savedInstanceState) {
        dataBinding = DataBindingUtil.setContentView(this, R.layout.set_activity_my_evaluate);
        dataBinding.setLifecycleOwner(this);
        dataBinding.setViewModel(mViewModel);
        initViewData();
        initRecycle();
        initClink();
    }
    private void initViewData(){
        //设置状态颜色和字体黑色
        StatusBarUtils.with(this,false)
                .setIsActionBar(false)
                .clearActionBarShadow()
                .setDrawable(getResources().getDrawable(com.mylib.libcore.R.drawable.sys_color))
                .init();
        dataBinding.bindSysToolBar.toolBarTvTitle.setText("动态评论详情");

    }
    private void initClink(){
        dataBinding.bindSysToolBar.toolBarIvBack.setOnClickListener(v -> {
            finishhideSoftBoard();
            finish();
        });
    }

    private void initRecycle(){
        RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(this);
        dataBinding.recycle.setLayoutManager(layoutManager);
        myEvaluateRecycleAdapter = new MyEvaluateRecycleAdapter(R.layout.set_item_my_evalute_hf);
        dataBinding.recycle.setAdapter(myEvaluateRecycleAdapter);
        List<String> listString = new ArrayList<>();
        for(int i=0;i<10;i++){
            listString.add("");
        }
        myEvaluateRecycleAdapter.setNewData(listString);
        myEvaluateRecycleAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {
                
            }
        });
    }

    @Override
    protected void onDestroy() {
        finishhideSoftBoard();
        super.onDestroy();
    }
}
